/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model.Business;

import ConnectMySQLServer.DataAccess;
import Model.Entity.Account;
import Model.Entity.Book;
import Model.Entity.Category;
import java.util.ArrayList;

/**
 *
 * @author CUONGTROC
 */
public class Business {
    public static ArrayList<Category> getAllCategory() throws Exception{
        DataAccess da = new DataAccess();
        return da.getAllCategory();
    }
    public static ArrayList<Book> getAllBook() throws Exception{
        DataAccess da = new DataAccess();
        return da.getAllBook();
    }
    public static Account getAccount(Account acc)throws Exception{
        DataAccess da  = new DataAccess();
        return da.getAccount(acc);
    }
    public static Account addAccount(Account account) throws Exception{
        DataAccess da = new DataAccess();
        return da.addAccount(account);
    }
    public static Book getBookDetail(String BookID) throws Exception{
        DataAccess da = new DataAccess();
        return da.getBookDetails(BookID);
    }
    public static ArrayList<Book> searchBook(String keyword) throws Exception{
        DataAccess da = new DataAccess();
        return da.searchBook(keyword);
    }
    public static ArrayList<Book> bookByCategory(String CategoryID)throws Exception{
        DataAccess da = new DataAccess();
        return da.getBooksInCategory(CategoryID);
    }
}
